Builder

public final class Builder

A builder of Cookie.

Builders are created by invoking newBuilder. Each of the setter methods modifies the state of the builder and returns the same instance. Builders are not thread-safe and should not be used concurrently from multiple threads without external synchronization.

Functions

Link copied to clipboard
public Cookie build()
Returns a new Cookie built from the current state of this builder.
Link copied to clipboard
public Cookie.Builder creationTime(Timestamp creationTime)
Sets the cookie creation time.
Link copied to clipboard
public Cookie.Builder expirationTime(Timestamp expirationTime)
Sets the cookie expiration time.
Link copied to clipboard
public Cookie.Builder httpOnly(boolean httpOnly)
Specifies whether the cookie is considered HTTP only.
Link copied to clipboard
public Cookie.Builder name(String name)
Sets the cookie name.
Link copied to clipboard
public Cookie.Builder path(String path)
Sets the cookie path.
Link copied to clipboard
public Cookie.Builder sameSite(SameSite sameSite)
Sets the SameSite cookie attribute value that allows you to declare if your cookie should be restricted to a first-party or same-site context.
Link copied to clipboard
public Cookie.Builder secure(boolean secure)
Specifies whether the cookie is restricted to a secure protocol (HTTPS or WSS) or it can be sent using any protocol.
Link copied to clipboard
public Cookie.Builder value(String value)
Sets the cookie value.